package com.sizu.web;


import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.sizu.common.vo.ResultEntity;
import com.sizu.entity.TUser;
import com.sizu.service.ITUserService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Mht
 * @since 2020-02-22
 */
@RestController
@RequestMapping("/user/tUser")
public class TUserController {

    @Resource
    private ITUserService itUserService;

    /**
     * 根据条件返回用户
     * @param tUser
     * @return
     */
    @RequestMapping("/list")
    public ResultEntity tUserList(TUser tUser){
        Wrapper<TUser> wrapper=new EntityWrapper<>(tUser);
        List<TUser> tUsers = itUserService.selectList(wrapper);
        return ResultEntity.ok("查询成功",tUsers);
    }

}
